evaluating algebraic expressions